package com.ruoyi.system.api;

import java.util.List;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysRole;
import com.ruoyi.system.api.factory.RemoteSysRoleFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;


/**
 * 角色信息微服务接口
 * 
 * @author ruoyi
 * @date 2023-04-27
 */
@FeignClient(contextId = "remoteSysRoleService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSysRoleFallbackFactory.class)
public interface RemoteSysRoleService
{
    /**
     * 查询角色信息
     * 
     * @param roleId 角色信息主键
     * @return 角色信息
     */
    @GetMapping("/inner/role/{roleId}")
    public R<SysRole> selectSysRoleByRoleId(@PathVariable("roleId") Long roleId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 查询角色信息列表
     * 
     * @param sysRole 角色信息
     * @return 角色信息集合
     */
    @PostMapping("/inner/role/list")
    public R<List<SysRole>> selectSysRoleList(SysRole sysRole, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 新增角色信息
     * 
     * @param sysRole 角色信息
     * @return 结果
     */
    @PostMapping("/inner/role")
    public R<Integer> insertSysRole(@RequestBody SysRole sysRole, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 修改角色信息
     * 
     * @param sysRole 角色信息
     * @return 结果
     */
    @PutMapping("/inner/role")
    public R<Integer> updateSysRole(@RequestBody SysRole sysRole, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 批量删除角色信息
     * 
     * @param roleIds 需要删除的角色信息主键集合
     * @return 结果
     */
    @DeleteMapping("/inner/role/{roleIds}")
    public R<Integer> deleteSysRoleByRoleIds(@PathVariable("roleIds") Long[] roleIds, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
